package org.spring.learn.demo.annotation.configures.lifecyle;

import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class MyTest {

    @Test
    public void test(){

        AnnotationConfigApplicationContext app = new AnnotationConfigApplicationContext(MyConfig.class);
        System.out.println("IoC容器创建");
//        Car car =(Car) app.getBean("car");
//
//        Car car2 =(Car) app.getBean("car");
//        System.out.println(car==car2);
//        car.run();
//        System.out.println(app.getBean("train"));
        app.close();
    }
}
